<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="author" content="">
    <title></title>  <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon" />
    <% include("../inc/input_css.html"){}%>
    <style>
        .control-label{
            width: 140px!important;
        }
    </style>

    <%
        var isAdd = false;
        var isEdit = false;
        if(isEmpty(article.id)){
        isAdd = true;
        }else{
        isEdit = true;
        }
    %>
</head>
<body>
<div class="ibox">
    <div class="ibox-title">
        <div class="pull-left mbx navbar_title">
            <span class="current">内容管理</span>
            <span class="line">/</span>
            <span class="current"><a href="list">文章管理</a></span><span class="line">/</span>
            <%if(isAdd){%>添加文章<%}else{%>编辑文章<%}%>
        </div>
    </div>
    <div class="ibox-content">
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="padding-40">
                    <form method="post" action="<%if (isAdd){%>save<%}else{%>update<%}%>"  class="form-horizontal form-validate">
                        <input type="hidden" name="article.id" value="${article.id!}" />
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="maroon">*</span>文章标题</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.title" value="${article.title!}" class="form-control light-input" data-rule-required="true">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">文章分类</label>
                                <div class="col-sm-3">
                                    <select name="article.articleCategory_id" value="" class="form-control light-input" required>
                                        <option value="">请选择</option>
                                        <%for(list in articleCategoryTreeList){%>
                                        <option value="${list.id}"<%if (list.id == article.articleCategory_id!){%> selected<%}%>>
                                        <%if (list.level != 0){%>
                                        <%for( i in range(0,list.level!0)){%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%}%>
                                        <%}%>
                                        ${list.name}
                                        </option>
                                        <%}%>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="maroon">*</span>作者</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.author" value="${article.author!}" class="form-control light-input" data-rule-required="true">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否推荐</label>
                                <div class="col-sm-3 col-md-3  col-lg-2 ">
                                    <div class="right_cont_r radio i-checks">
                                        <input type="radio" value="true" name="article.isRecommend" <%if (article.isRecommend! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                        <input type="radio" value="false" name="article.isRecommend" class="right_cont_r_l" <%if (isAdd || article.isRecommend == false){%> checked<%}%>><span>否</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否置顶</label>
                                <div class="col-sm-3 col-md-3  col-lg-2 ">
                                    <div class="right_cont_r radio i-checks">
                                        <input type="radio" value="true" name="article.isTop" <%if (article.isTop! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                        <input type="radio" value="false" name="article.isTop" class="right_cont_r_l" <%if (isAdd || article.isTop == false){%> checked<%}%>><span>否</span>
                                    </div>
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label class="col-sm-2 control-label">是否发布到首页</label>
                                <div class="col-sm-3 col-md-3  col-lg-2 ">
                                    <div class="right_cont_r radio i-checks">
                                        <input type="radio" value="true" name="article.isShowImg" <%if (article.isShowImg! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                        <input type="radio" value="false" name="article.isShowImg" class="right_cont_r_l" <%if (isAdd || article.isShowImg == false){%> checked<%}%>><span>否</span>
                                    </div>
                                </div>
                            </div>-->
                            <!--<div class="form-group">
                                <label class="col-sm-2 control-label">是否发布</label>
                                <div class="col-sm-3 col-md-3  col-lg-2 ">
                                    <div class="right_cont_r radio i-checks">
                                        <input type="radio" value="true" name="article.isPublication" <%if (article.isPublication! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                        <input type="radio" value="false" name="article.isPublication" class="right_cont_r_l" <%if (isAdd || article.isPublication == false){%> checked<%}%>><span>否</span>
                                    </div>
                                </div>
                            </div>-->

                            <!--<div class="form-group">
                                <label class="col-sm-2 control-label"><span class="maroon">*</span>外链地址</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.url" value="${article.url!}" class="form-control light-input" data-rule-required="true">
                                </div>
                            </div>-->


                            <div class="form-group">
                                <label class="col-sm-2 control-label">封面图片</label>
                                <div class="col-sm-3">
                                    <input type="hidden" name="brandLogo" value="${article.imgurl!}" class="pull-left form-control light-input"/>
                                    <img class="img-rounded" src="${article.imgurl!}" style="max-height:50px;"/>
                                    <input type="button" class="button browserButton" value="选择文件"/>
                                    <span class="help-block"><span class="maroon"></span>建议300*300像素；格式jpg</span>
                                </div>
                            </div>
                           <!--<div class="form-group">
                                <label class="col-sm-2 control-label">视频file_id</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.videoFileId" value="${article.videoFileId!}" class="form-control light-input">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">视频app_id</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.videoAppId" value="${article.videoAppId!}" class="form-control light-input">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否播放视频</label>
                                <div class="col-sm-3 col-md-3  col-lg-2 ">
                                    <div class="right_cont_r radio i-checks">
                                        <input type="radio" value="true" name="article.isPlayVideo" <%if (article.isPlayVideo! == true){%> checked<%}%>><span style="margin-right: 15px;">是</span>
                                        <input type="radio" value="false" name="article.isPlayVideo" class="right_cont_r_l" <%if (isAdd || article.isPlayVideo == false){%> checked<%}%>><span>否</span>
                                    </div>
                                </div>
                            </div>-->

                            <div class="form-group">
                                <label class="col-sm-2 control-label">内容</label>
                                <div class="col-sm-3">
                                    <textarea id="personInfo" name="article.content" rows="10" style="width: 100%">${article.content!}</textarea>
                                </div>
                            </div>
                            <!--<div class="form-group">
                                <label class="col-sm-2 control-label"><span class="maroon"></span>页面关键词</label>
                                <div class="col-sm-3">
                                    <input type="text" name="article.metaKeywords" value="${article.metaKeywords!}" class="form-control light-input">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">页面描述</label>
                                <div class="col-sm-3">
                                    <textarea class="form-control light-input"  name="article.metaDescription" rows="7" style="width: 100%">${article.metaDescription!}</textarea>
                                </div>
                            </div>-->

                        <div class="form-group" style="margin-top: 24px">
                            <label class="col-sm-2 control-label "></label>
                            <div class="col-sm-4 col-sm-offset-0">
                                <button class="hive-btn-cancle" id="btn_cancle" type="button" onclick="history.back()">&nbsp;取消&nbsp;</button>
                                <button class="hive-btn hive-btn-primary margin-left-8" type="submit">&nbsp;提交&nbsp;
                                </button>
                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<% include("../inc/input_js.html"){}%>
<!-- 自定义js -->
<!--kindEditor-->
<script src="https://static.9hive.cn/global/vendor/kindeditor/kindeditor-all-min.js"></script>
<script src="https://static.9hive.cn/global/vendor/kindeditor/lang/zh-CN.js"></script>
<script type="text/javascript">
    KindEditor.ready(function (K) {
        personInfoeditor = K.create("#personInfo", {
            themeType: 'simple',
            allowFileManager: true,
            width:"300%",
            height:"260px",
            uploadJson: '${base}/file/uploadfile?shopId=${shopId!}&type=k',
            fileManagerJson: '${base}/file/fileManagerJson?shopId=${shopId!}'
        });
    });
</script>
<script type="text/javascript">
    var uploadUrl="/file/uploadfile?shopId=${shopId!}&type=d";
    var browserUrl="/file/browser?shopId=${shopId!}";
</script>
<script src="https://static.9hive.cn/global/vendor/file/file.js"></script>
<script type="text/javascript">
    $(function () {
        $("input.browserButton").browser();
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_flat-blue',
            radioClass: 'iradio_flat-blue',
        });

    })
</script>
</html>
